import { ITradeQueryParams, ITradePagination } from '@shared/interfaces/trade'
import { Observable } from 'rxjs'
import {
  ITradeHoldCheckReq,
  ITradeHoldReq,
  ITradeReleaseReq,
  IHoldReleaseDetailObj,
  ICodeMsgResponse,
  IChargeBack,
  IChargeBackPagination,
  IChargeBackQueryParams,
  IChargeBackOperateReq,
  EChargeBackTransCode,
} from '@shared/interfaces/operation'
import { IGeneralResponse, IReportResponse } from '@shared/interfaces/response'

export abstract class OperationsService {
  /** 获取暂扣列表 */
  abstract getHoldList(params: ITradeQueryParams, str?: string): Observable<ITradePagination>

  /** 获取暂扣详情 */
  abstract getHoldOne(intStoreCode: string, orderNum: string): Observable<IHoldReleaseDetailObj>

  /** 查询是否暂扣 */
  abstract checkHold(data: ITradeHoldCheckReq, str?: string): Observable<any>

  /** 暂扣 */
  abstract hold(data: ITradeHoldReq): Observable<boolean>

  /** 释放 */
  abstract release(data: ITradeReleaseReq): Observable<ICodeMsgResponse>

  /** 获取差错列表 */
  abstract getChargeBackList(params: IChargeBackQueryParams, str?: string): Observable<IChargeBackPagination>

  /** 获取差错详情 */
  abstract getChargeBackOne(disputeNum: string): Observable<IChargeBack>

  /** 处理差错 */
  abstract handleChargeBack(req: IChargeBackOperateReq, transCode: EChargeBackTransCode): Observable<IGeneralResponse>

  /** 下载差错 */
  abstract getChargeBackReport(params: IChargeBackQueryParams, str?: string): Observable<IReportResponse>
}
